package com.yidian.server.business;

import com.yidian.entity.PageResult;
import com.yidian.pojo.business.Ad;

import java.util.List;
import java.util.Map;

/**
 * @author whb
 * @create 2021-06-17 15:49
 * @desciption 广告Service接口
 */
public interface AdService {
    public List<Ad> findAll();

    public PageResult<Ad> findPage(int page, int size);

    public List<Ad> findList(Map<String, Object> searchMap);

    public PageResult<Ad> findPage(Map<String, Object> searchMap, int page, int size);

    public Ad findById(Integer id);

    public void add(Ad ad);

    public void update(Ad ad);

    public void delete(Integer id);

    public List<Ad> findByPosition(String position);

    /**
     * 根据广告位查询广告信息，存入到redis
     * @param position
     */
    public void saveAdToRedisByPosition(String position);

    /**
     * 查询所有位置的广告，存入到redis
     */
    public void saveAllAdToRedis();
}
